package com.ruoyi.shopping.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shopping.mapper.MallCommissionBalanceMapper;
import com.ruoyi.shopping.domain.MallCommissionBalance;
import com.ruoyi.shopping.service.IMallCommissionBalanceService;

/**
 * 佣金余额Service业务层处理
 *
 * @author scx
 * @date 2022-06-10
 */
@Service
public class MallCommissionBalanceServiceImpl implements IMallCommissionBalanceService
{
    @Autowired
    private MallCommissionBalanceMapper mallCommissionBalanceMapper;

    /**
     * 查询佣金余额
     *
     * @param id 佣金余额主键
     * @return 佣金余额
     */
    @Override
    public MallCommissionBalance selectMallCommissionBalanceById(Long id)
    {
        return mallCommissionBalanceMapper.selectMallCommissionBalanceById(id);
    }

    /**
     * 查询佣金余额列表
     *
     * @param mallCommissionBalance 佣金余额
     * @return 佣金余额
     */
    @Override
    public List<MallCommissionBalance> selectMallCommissionBalanceList(MallCommissionBalance mallCommissionBalance)
    {
        return mallCommissionBalanceMapper.selectMallCommissionBalanceList(mallCommissionBalance);
    }

    /**
     * 新增佣金余额
     *
     * @param mallCommissionBalance 佣金余额
     * @return 结果
     */
    @Override
    public int insertMallCommissionBalance(MallCommissionBalance mallCommissionBalance)
    {
        mallCommissionBalance.setCreateTime(DateUtils.getNowDate());
        return mallCommissionBalanceMapper.insertMallCommissionBalance(mallCommissionBalance);
    }

    /**
     * 修改佣金余额
     *
     * @param mallCommissionBalance 佣金余额
     * @return 结果
     */
    @Override
    public int updateMallCommissionBalance(MallCommissionBalance mallCommissionBalance)
    {
        mallCommissionBalance.setUpdateTime(DateUtils.getNowDate());
        return mallCommissionBalanceMapper.updateMallCommissionBalance(mallCommissionBalance);
    }

    /**
     * 批量删除佣金余额
     *
     * @param ids 需要删除的佣金余额主键
     * @return 结果
     */
    @Override
    public int deleteMallCommissionBalanceByIds(Long[] ids)
    {
        return mallCommissionBalanceMapper.deleteMallCommissionBalanceByIds(ids);
    }


    /**
     * 批量逻辑删除佣金余额
     *
     * @param ids 需要删除的佣金余额主键
     * @return 结果
     */
    @Override
    public int logicDeleteMallCommissionBalance(Long[] ids,String delType,Long delUser)
    {
        return mallCommissionBalanceMapper.logicDeleteMallCommissionBalance(ids,delType,delUser);
    }

    /**
     * 删除佣金余额信息
     *
     * @param id 佣金余额主键
     * @return 结果
     */
    @Override
    public int deleteMallCommissionBalanceById(Long id)
    {
        return mallCommissionBalanceMapper.deleteMallCommissionBalanceById(id);
    }
}
